<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>学生成绩管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="manager_course.css">
</head>
<body>
<div class="layout">
    <!-- 侧边栏 -->
    <nav class="sidebar">
        <div class="sidebar-title">学生成绩管理系统</div>
        <div class="sidebar-menu">
            <a href="manager_student.html">用户管理</a>
            <a href="manager_teacher.html">老师管理</a>
            <a class="active" href="manager_course.html">课程管理</a>
        </div>
        <div class="sidebar-logout">退出登录</div>
    </nav>
    <!-- 主内容区 -->
    <div class="main">
        <!-- 顶部栏 -->
        <div class="header">
            <span class="header-title">学生成绩管理系统</span>
            <span class="header-user">name【管理员】</span>
        </div>
        <div class="content">
            <!-- 背景装饰 -->
            <div class="decoration-yellow"></div>
            <div class="decoration-red"></div>
            <div class="decoration-green"></div>

            <div class="card">
                <div class="actions-bar">
                    <button class="btn btn-info" onclick="openAddCourseModal()">➕ 新增</button>
                    <input class="search-input"  id="courseNameInput" placeholder="课程名" />
                    <button class="btn btn-info" onclick="searchCourse()">🔍</button>
                </div>

                <!-- 模态对话框 -->
                <div id="addCourseModal" class="modal">
                    <div class="modal-content">
                        <span class="close-btn" onclick="closeAddCourseModal()">&times;</span>
                        <h2>新增课程</h2>
                        <!-- 表单内容 -->
                        <form id="addCourseForm">
                            <div class="form-group">
                                <label for="cno">课程号:</label>
                                <input type="text" id="cno" name="cno" required>
                            </div>
                            <div class="form-group">
                                <label for="cname">课程名:</label>
                                <input type="text" id="cname" name="cname" required>
                            </div>
                            <div class="form-group">
                                <label for="chours">课时:</label>
                                <input type="text" id="chours" name="chours" required>
                            </div>
                            <div class="form-group">
                                <label for="teacherName">教师名:</label>
                                <input type="text" id="teacherName" name="teacherName" required>
                            </div>
                            <div class="form-group">
                                <label for="classcode">班级名:</label>
                                <input type="text" id="classcode" name="classcode" required>
                            </div>
                            
                            <div class="button-group">
                                <button type="submit" class="btn btn-success">保存</button>
                                <button type="button" class="btn btn-secondary" onclick="closeAddCourseModal()">取消</button>
                            </div>
                        </form>
                    </div>
                </div>


                <table class="table" id="table">
                    <thead>
                    <tr>
                        <th>课程名</th><th>课时</th><th>状态</th><th>课容量</th><th>创建时间</th><th>操作</th>
                    </tr>
                    </thead>
                    <tbody>

                    <!-- ...更多课程 -->
                    </tbody>
                </table>

            </div>
            </div>
            </div>

            </div>

<!-- 删除确认弹窗 -->
<div id="deleteConfirmModal" class="modal" data-id="${course.id}" >
    <div class="modal-content">
        <span class="close-btn" onclick="closeDeleteConfirmModal()">&times;</span>
        <h3>确认删除</h3>
        <p>您确定要删除这条记录吗？此操作不可恢复。</p>
        <div class="button-group">
            <td><button class="btn btn-danger" onclick="confirmDelete()">🗑 删除</button></td>

            <button type="button" class="btn btn-secondary"  id="course-container" onclick="closeDeleteConfirmModal()">取消</button>
        </div>
    </div>
</div>
</div>



<script src="manager_course.js"></script>

</body>
</html>
